package zdx.lesson;

public class MidNarcissisticNumbers {
    public static void num()
    {
        for(int i=100;i<999;i++){
            int last =0;
            int sum  =0;
            int num  =i;
            while(num != 0){
                last = num%10;
                sum+=last*last*last;
                num/=10;
                if(num==0 && i==sum){
                    System.out.print(i+" ");
                }
            }
        }
    }

    public static void main(String[] args) {
        num();
    }

}
